package com.vito.framework.system.feature.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vito.framework.base.exception.CommonException;
import com.vito.framework.base.service.impl.BaseServiceImpl;
import com.vito.framework.system.feature.mapper.FeatureMapper;
import com.vito.framework.system.feature.model.Feature;
import com.vito.framework.system.feature.service.FeatureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 作者：包子
 * 时间：2020/10/9 15:31
 * 描述：
 */
@Service
public class FeatureServiceImpl extends BaseServiceImpl<FeatureMapper, Feature> implements FeatureService {
    @Autowired
    FeatureMapper featureMapper;

    @Override
    public IPage<Feature> list(Map<String, Object> paramMap) {
        Page<Feature> page = new Page<>((Integer) paramMap.get("param_curpage"), (Integer) paramMap.get("param_ipagecount"));
        return featureMapper.list(page, paramMap);
    }

    @Override
    public Feature get(Integer id) throws CommonException {
        return featureMapper.get(id);
    }
}
